﻿<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>创建主机和板卡</title>
	<link rel="stylesheet" href="../css/css.css">
	<script type="text/javascript" src="../js/jquery-1.8.3.js"></script>
	<link type="text/css" rel="Stylesheet" href="../css/nmc.css" />
	<script type="text/javascript" src="../js/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="../js/messagecenter.js"></script>
	<script type="text/javascript" src="../js/common.js"></script>
	<script type="text/javascript" src="../js/data3.js"></script>
	<script type="text/javascript" src="../js/canvas3.js"></script>
	<style type="text/css">
		.app_text{
			color:#04A0E9;
		}
		.page-split input{
			display:inline;
			margin:0px 4px;
		}
		.r-text{
			font-size: 13px;
			text-align: center;
			margin-top: 10px;
		}

	</style>
	<script>
        window.onload = function() {
            var canvasData = {x:320 , y:52, width:Math.ceil(window.innerWidth-325), height:Math.ceil(window.innerHeight-152)};
            init_canvas(canvasData ,1,lineEvent1 , lineEvent2 ,lineEvent3,iconEvent4);//初始化
            drawCircles();
        };
        function lineEvent1(){}
        function lineEvent2(){}
        function lineEvent3(){}
        function  iconEvent4(obj){
            alert("板卡");
            alert(JSON.stringify(obj));
			window.location.href="../html/newCpus.html";
			
        }

	</script>
</head>
<body>
<div class="left_content">
	<div class="left_block1">
		<div class="left_logo"></div>
		<div class="left_title">品牌数据库编辑器，高效工作，人性化交互</div>
		<div class="left_icons">
			<div class="left_icon1"></div>
			<div class="left_icon2"></div>
			<div class="left_icon3"></div>
		</div>
	</div>
	<div class="left_block2">
		<div class="left_menu">拓扑文件库</div>
		<div class="left_menu">逻辑预案库</div>
		<div class="left_menu">部署库</div>
		<div class="left_menu">监控</div>
		<div class="left_menu">其他</div>
	</div>
	<div class="left_block3">
		<div class="left_title">快捷管理机箱、板卡、芯片，提高工作效率便捷查找功能相关物理和逻辑链接，高效编辑请登陆BDE账号</div>
		<button class="login">登录</button>
	</div>
</div>
<div class="right_content" >
	<form id="form1">
		<input type="hidden" id="curId" name="curId">
		<!-- 头部 -->
		<div class="top-bar">
			<button class="b4" type="button" onclick="nextStep();">下一步</button>
			<button class="b5" type="button" onclick="showView();">预览</button>
			<button  class="b6" type="button" onclick="save();">保存</button>
		</div>


		<!-- 右侧 -->
		<div class="right">
			<div class="r0 app_text">APP</div>
		</div>
		<!-- 左侧 -->
		<div class="table-box">

		</div>
		<!-- 底部 -->
		<div class="bottom">
			<div class="btm-bar">
				<div class="bar1">属性</div>
			</div>
			<div class="bt2">
				<div>编号&nbsp;:</div>
				<div><input type="text" id="boardId" placeholder="输入编号"/></div>
			</div>
			<div class="bt3">
				<div>名称&nbsp;:</div>
				<div><input type="text" id="boardName" placeholder="输入名称"></div>
			</div>
			<div class="bt4">
				<div>类型&nbsp;:</div>
				<div style="margin-left:20px;">
					<select style="width:100px;border:none;color:#434C55;" id="boardType">
						<option value="0">选择类型</option>
						<option value="1">1</option>
						<option value="2">2</option>

					</select>
				</div>
			</div>
			<div class="bt5">
				<div>备注&nbsp;:</div>
				<div style="position:absolute;left:40px;right:10px;top:0px;bottom:0px; "><input type="text" id="remark" placeholder="输入备注信息文字描述" style="width:100%;"></div>
			</div>
		</div>
	</form>
</div>

</body>
<script type="text/javascript">
	//主机machines
    var machines=canvasAllLevel1;
	//板卡boarders
	var boarders=canvasAllLevel2;
	function nextStep(){
		if(machines.length==0){
			alert("请先添加主机");
			return false;
		}else{		
			var url="";
			var params=machines;
			$.post(url,params,"JSON").done(function(data){
				if(data){
					alert(data.messege);
				}
			});
			
			//保存板卡
			if(boarders.length!=0){
			var url="";
			var params=boarders;
			$.post(url,params,"JSON").done(function(data){
				if(data){
					alert(data.messege);
				}
			});
		}
		window.location.href="../html/newCpus.html";
		}
		
	}

    function save() {
        if(machines.length==0){
			alert("请先添加主机");
			return false;
		}else{
			var url="";
			var params=machines;
			$.post(url,params,"JSON").done(function(data){
				if(data){
					alert(data.messege);
				}
			});
			
			//保存板卡
			if(boarders.length!=0){
			var url="";
			var params=boarders;
			$.post(url,params,"JSON").done(function(data){
				if(data){
					alert(data.messege);
				}
			});
		}
		}
		
    }

    function showView(){
        alert("全局预览");
		if(machines.length==0){
			alert("请先添加主机");
			return false;
		}else{
			var url="";
			var params=machines;
			$.post(url,params,"JSON").done(function(data){
				if(data){
					alert(data.messege);
				}
			});
			
			//保存板卡
			if(boarders.length!=0){
			var url="";
			var params=boarders;
			$.post(url,params,"JSON").done(function(data){
				if(data){
					alert(data.messege);
				}
			});
		}
        winddow.location.href="../html/physicalTopView.html";
		}
		
    }
</script>
</html>
